package com.chris.homecare.screens
{
	import com.chris.homecare.components.BreadcrumbComponenet;
	import com.chris.homecare.components.BulletHeadingComp;
	import com.chris.homecare.components.HeaderComponent;
	import com.chris.homecare.data.DataUtil;
	import com.chris.homecare.utils.CommonUtils;
	
	import feathers.controls.Label;
	import feathers.controls.LayoutGroup;
	import feathers.controls.Screen;
	import feathers.controls.ScrollText;
	import feathers.layout.VerticalLayout;
	
	import starling.display.Image;
	
	public class BusinessScreen extends Screen
	{
		private var headingImg:Image;
		private var headingLabel:Label;
		private var breadcrumbComp:BreadcrumbComponenet;
		private var scrollText:ScrollText;
		private var layoutGroup:LayoutGroup;

		private var header:HeaderComponent;
		private var bulletHeadingComp:BulletHeadingComp;
		private var businessObject:Object;
		
		public function BusinessScreen()
		{
			businessObject = DataUtil.getBusinessData();
			super();
		}
		
		override protected function initialize():void
		{
			var vertLayout:VerticalLayout = new VerticalLayout();
			vertLayout.horizontalAlign = VerticalLayout.HORIZONTAL_ALIGN_CENTER;
			this.layout = vertLayout;
			
			header = new HeaderComponent();
			addChild(header);
			
			breadcrumbComp = new BreadcrumbComponenet("Info", "Business");
			addChild(breadcrumbComp);
			
			bulletHeadingComp = new BulletHeadingComp(businessObject.heading);
			addChild(bulletHeadingComp);
			
			scrollText = new ScrollText();
			scrollText.nameList.add("custom-evt-scroll-txt");
			scrollText.isHTML = true;
			scrollText.text = businessObject.content;
			addChild(scrollText);
			
			super.initialize();
		}
		
		override protected function draw():void
		{
			super.draw();
			
			scrollText.width = stage.stageWidth - 40*CommonUtils.scaleValue;
			scrollText.height = stage.stageHeight - (header.height + bulletHeadingComp.height + breadcrumbComp.height + 40*CommonUtils.scaleValue);
		}
	}
}